package java基础知识.多态;

/**
 * @author coderFu
 * @create 2022/3/9
 * 多态的实现
 */
public class CoderMutState extends CoderMutStateParent{

    @Override
    public void test() {
        System.out.println("调用了子类的方法");
    }

    public static void main(String[] args) {
        CoderMutStateParent coder = new CoderMutState();
       // coder.test();


        // 接口的多态
        CoderMutInterface coderImpl1 = new CoderMutImpl1();

        CoderMutInterface coderImpl2 = new CoderMutImpl2();

        coderImpl1.sayHell("coderImpl1");

        coderImpl2.sayHell("coderImpl2");
    }
}
